<template>
  <div style="padding: 5px">
    <el-card @click="download">
      <el-row :span="24">
        <el-col :span="5">
          <el-avatar v-if="file.extName == 'docx' || file.extName == 'doc'" shape="square" :size="50" fit="fill" style="background-color: white" src="/file/docx.png" />
          <el-avatar v-else-if="file.extName == 'pdf'" shape="square" :size="50" fit="fill" style="background-color: white" src="/file/pdf.png" />
          <el-avatar v-else-if="file.extName == 'zip'" shape="square" :size="50" fit="fill" style="background-color: white" src="/file/zip.png" />
          <el-avatar v-else shape="square" :size="50" fit="fill" style="background-color: white" src="/file/file.png" />
        </el-col>
        <el-col :span="2"></el-col>
        <el-col :span="16">
          <h4>{{ file.fileName }}</h4>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>
<script setup>
import request from '@/utils/request'
const emit = defineEmits(["confirm"]);
const { proxy } = getCurrentInstance();
const props = defineProps({
  file: {
    type: [Object],
  },
});
// 下载文件
function download(){
  emit('confirm',props.file.id)
}
</script>
